
{extend name="index/admin-index" /}
{block name="main"}

  <link rel="stylesheet" href="/public/static/assets/css/bootstrap.css">
  <script src="/public/static/assets/js/jquery.min.js"></script>
  <!-- content start -->
  <div class="admin-content">
    <div class="admin-content-body">
      <div class="am-cf am-padding am-padding-bottom-0">
        <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">友情链接添加</strong> / <small>links addition</small></div>
      </div>

      <hr/>

      <div style="margin-left:100px">
     
        
    <form action="{:url('admin/Links/add')}" class="form-inline" enctype="multipart/form-data" method="post" id='form'>
    <div class="form-group has-success has-feedback">
    <label class="control-label" for="inputSuccess4"></label>

    <strong class="am-text-primary am-text-lg">站点名 : &nbsp</strong>
    <input type="text" class="form-control" name="linkname" id="inputSuccess4" aria-describedby="inputSuccess4Status"  style='width:400px' placeholder='请输入站点名称'><br><br>

    <strong class="am-text-primary am-text-lg"> &nbsp链接 : &nbsp&nbsp&nbsp&nbsp</strong>
    <input type='text' class="form-control" placeholder='请输入链接' name="interlink" style='width:400px'><br><br>
    <strong class="am-text-primary am-text-lg"> &nbsp状态 : &nbsp&nbsp&nbsp&nbsp&nbsp</strong>
    <label><input type="radio" name='status' value=1 class="am-text-primary am-text-lg" checked>正常</label>&nbsp&nbsp
    <label><input type="radio" name='status' value=0 class="am-text-primary am-text-lg">禁用</label>

    <br>
    <br>
    <a href="javascript:void(0)" type="submit"  class="btn btn-info " style='float:right;' id='add'>添加</a>
    
    </div>
    </form>
    </div>
    <script>
        $('#add').click(function(){
          var info = $('#form input').serialize();
          $.ajax({
            type:'post',
            url:"{:url('admin/Links/add')}",
            data:info,
            success:function(d){
                if(d == 'ok'){
                    alert('添加成功');
                    window.location='lst';
                }else if(d == 'no'){
                    alert('添加失败');
                }else{
                    alert(d);
                }
            }
          })
        })
</script>
{/block}